;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages pier)
  #:use-module (gnu packages)
  #:use-module (gnu packages check)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages tls)
  #:use-module ((guixrus packages common rust) #:prefix rus:)
  #:use-module (guix build-system cargo)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define-public pier
  (package
    (name "pier")
    (version "0.1.5")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "pier" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32 "1w0wdfsaplcaf52q1jam6vwdf2zmk3gifzmzzarngjl2mg340kbn"))))
    (build-system cargo-build-system)
    (arguments
     (list #:cargo-test-flags
           '(list "--release" "--"
                  "--skip=cli::test_run_custom_exit_code"
                  "--skip=cli::test_run_inline_with_args"
                  "--skip=cli::test_run_script"
                  "--skip=cli::test_run_script_and"
                  "--skip=cli::test_run_script_non_blocking"
                  "--skip=cli::test_run_script_pipe"
                  "--skip=cli::test_run_shebang_with_args"
                  "--skip=cli::test_run_successful"
                  "--skip=cli::test_run_with_interpreter"
                  "--skip=cli::test_run_with_shebang"
                  "--skip=cli::test_stderr_output")
           #:cargo-inputs
           `(("rust-dirs" ,rust-dirs-2)
             ("rust-enum-kinds" ,rus:rust-enum-kinds-0.4)
             ("rust-prettytable-rs" ,rust-prettytable-rs-0.8)
             ("rust-scrawl" ,rus:rust-scrawl-1)
             ("rust-serde" ,rust-serde-1)
             ("rust-snafu" ,rus:rust-snafu-0.5)
             ("rust-structopt" ,rust-structopt-0.3)
             ("rust-tempfile" ,rust-tempfile-3)
             ("rust-toml" ,rust-toml-0.4))
           #:cargo-development-inputs
           `(("rust-assert-cmd" ,rus:rust-assert-cmd-0.11)
             ("rust-assert-fs" ,rus:rust-assert-fs-0.11)
             ("rust-predicates" ,rust-predicates-1)
             ("rust-serde" ,rust-serde-1))))
    (home-page "https://github.com/BenSchZA/pier")
    (synopsis "Personal script management tool")
    (description
     "This package provides a tool for managing your personal
scripts.")
    (license license:expat)))
